// Piece.cs created with MonoDevelop
// User: dream at 16:58 15.05.2008
//
using System;

namespace CheckAndMate
{	
	public struct Square
	{	
		public Square(File file, int rank)
		{
			if (rank < 1 || rank > 8)
				throw new ArgumentOutOfRangeException("file");
			if ((int)file < 1 || (int)file > 8)
				throw new ArgumentOutOfRangeException("rank");
			_file = file;
			_rank = rank;
		}
		
		public File File
		{
			get { return _file; }
		}
		
		public int Rank
		{
			get { return _rank; }
		}
		
		public static bool operator==(Square s1, Square s2)
		{
			if (s1._file == s2._file && s1._rank == s2._rank)
				return true;
			else 
				return false;
		}
		
		public static bool operator!=(Square s1, Square s2)
		{
			return !(s1 == s2);
		}
		
		private File _file;
		private int _rank;
	}
}
